package cn.saddyfire.pattern.command;

/**
 * @author Dee
 * @date 2024/2/20
 * <p>Description:
 */
public class Client {
    public static void main(String[] args) {
        //创建第一个订单对象
        Order order1 = new Order();
        order1.setDiningTable(1);
        order1.setFoodDir("西红柿鸡蛋面", 1);
        order1.setFoodDir("小杯可乐", 2);

        //创建第二个订单对象
        Order order2 = new Order();
        order2.setDiningTable(1);
        order2.setFoodDir("汤达人", 1);
        order2.setFoodDir("小贝雪碧", 2);

        //创建厨师对象
        SeniorChef receiver = new SeniorChef();
        //创建命令对象
        Command cmd1 = new OrderCommand(receiver, order1);
        Command cmd2 = new OrderCommand(receiver, order2);

        //创建调用者(服务员对象)
        Waitor invoke = new Waitor();
        invoke.setCommand(cmd1);
        invoke.setCommand(cmd2);

        //让服务员发起命令
        invoke.orderUp();
    }
}
